import { RouteRecordRaw } from 'vue-router'
import { Store, StoreAlt } from '@vicons/fa'
import { DotChartOutlined, ShopTwotone } from '@vicons/antd'
import { renderIcon } from '@/util'

declare module 'vue-router' {
    interface RouteMeta {
        title?: string
        role?: string
        icon?: any
        sort?: number
        real?: boolean
    }
}

const routes: Array<RouteRecordRaw> = [
    {
        path: '/mch',
        name: 'mch',
        redirect: '/mch/summary',
        component: () => import('@/views/layout/Index.vue'),
        meta: {
            title: '门店管理',
            icon: renderIcon(ShopTwotone),
            role: 'Dev,Adm',
            sort: 2,
        },
        children: [
            {
                path: 'summary',
                name: 'mch.summary',
                meta: {
                    title: '门店统计',
                    icon: renderIcon(DotChartOutlined),
                    role: 'Adm',
                },
                component: () => import('@/views/mch/summary/Index.vue'),
            },
            {
                path: 'info',
                name: 'mch.info',
                meta: {
                    title: '门店信息',
                    icon: renderIcon(Store),
                    role: 'Adm',
                },
                component: () => import('@/views/mch/info/Index.vue'),
            },
            {
                path: 'apply',
                name: 'mch.apply',
                meta: {
                    title: '入驻申请',
                    icon: renderIcon(StoreAlt),
                    role: 'Adm',
                },
                component: () => import('@/views/mch/apply/Index.vue'),
            },
        ],
    },
]

export default routes
